<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
    <script src="js/filters.js"></script>
</head>
<body>
    <div id="app">
        价格：{{price|keepdot2(3)|RMB}}<br>
        价格：{{price|keepdot2(2)|RMB}}<br>
        价格：{{price|keepdot2(1)|RMB}}<br>
        价格：{{price|keepdot2(3)}}<br>
    </div>

    <script>
        var vm1 = new Vue({
            el:"#app",
            data:{
                price: 20.3
            },
            methods:{},
            // 普通过滤器[局部过滤器]
            filters:{
                keepdot2(value,dot){
                    return value.toFixed(dot)
                }
            }
        })
    </script>

</body>
</html>
